This is based on pip package spinx-proof pip install it and set in configuration
````{prf:[below keywords]}
bdg-whiteProof bdg-whiteTheorem bdg-whiteAxiom bdg-whiteLemma bdg-whiteDefinition bdg-whiteCriterion bdg-whiteRemark bdg-whiteConjecture
bdg-whiteCorollary
bdg-whiteAlgorithm
bdg-whiteExample
bdg-whiteProperty
bdg-whiteObservation
bdg-whiteProposition
bdg-whiteAssumption
This package utilizes a Sphinx domain - named "proof" - to describe and link typeset markup objects (theorems, proofs, corollaries, etc.) which we think belong together. All directives follow the pattern {<domain_name>:<typeset>} while all the roles follow the pattern {<domain_name>:ref}. To utilize any directive in the proof domain follow the pattern {prf:<typeset>}. To reference any directive follow the pattern {prf:ref}.
A proof directive can be included using the prf:proof pattern. Unlike the other directives provided through this extension, a proof directive does not include any parameters nor does it require any arguments. A proof directive can easily be referenced through targets.
The following option is supported:
class : text
Value of the proof’s class attribute which can be used to add custom CSS or JavaScript.
Example
MyST Syntax
````{prf:proof}
We'll omit the full proof.
But we will prove sufficiency of the asserted conditions.
To this end, let $y \in \mathbb R^n$ and let $S$ be a linear subspace of $\mathbb R^n$.
Let $\hat y$ be a vector in $\mathbb R^n$ such that $\hat y \in S$ and $y - \hat y \perp S$.
Let $z$ be any other point in $S$ and use the fact that $S$ is a linear subspace to deduce
```{math}
\| y - z \|^2
= \| (y - \hat y) + (\hat y - z) \|^2
= \| y - \hat y \|^2 + \| \hat y - z \|^2
```
Hence $\| y - z \| \geq \| y - \hat y \|$, which completes the proof.
````
Source: QuantEcon
A theorem directive can be included using the prf:theorem pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your theorem that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the theorem’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off theorem auto numbering.
Example
MyST Syntax
````{prf:theorem} Orthogonal-Projection-Theorem
:label: my-theorem
Given $y \in \mathbb R^n$ and linear subspace $S \subset \mathbb R^n$,
there exists a unique solution to the minimization problem
```{math}
\hat y := \argmin_{z \in S} \|y - z\|
```
The minimizer $\hat y$ is the unique vector in $\mathbb R^n$ that satisfies
* $\hat y \in S$
* $y - \hat y \perp S$
The vector $\hat y$ is called the **orthogonal projection** of $y$ onto $S$.
````
Source: QuantEcon
You can refer to a theorem using the {prf:ref} role like: {prf:ref}`my-theorem` , which will replace the reference with the theorem number like so: prf:refmy-theorem. When an explicit text is provided, this caption will serve as the title of the reference. For example, {prf:ref}`Orthogonal-Projection-Theorem <my-theorem>` will produce: prf:refOrthogonal-Projection-Theorem .
An axiom directive can be included using the prf:axiom pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your axiom that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the axiom’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off axiom auto numbering.
Example
MyST Syntax
```{prf:axiom} Completeness of $\mathbb{R}$
:label: my-axiom
Every Cauchy sequence on the real line is convergent.
```
Source: citeeconomic-dynamics-book
You can refer to an axiom using the {prf:ref} role like: {prf:ref}`my-axiom` , which will replace the reference with the axiom number like so: prf:refmy-axiom. When an explicit text is provided, this caption will serve as the title of the reference.
A lemma directive can be included using the prf:lemma pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your lemma that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the lemma’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off lemma auto numbering.
Example
MyST Syntax
````{prf:lemma}
:label: my-lemma
If $\hat P$ is the fixed point of the map $\mathcal B \circ \mathcal D$ and $\hat F$ is the robust policy as given in [(7)](https://python-advanced.quantecon.org/robustness.html#equation-rb-oc-ih), then
```{math}
:label: rb_kft
K(\hat F, \theta) = (\theta I - C'\hat P C)^{-1} C' \hat P (A - B \hat F)
```
````
Source: QuantEcon
You can refer to a lemma using the {prf:ref} role like: {prf:ref}`my-lemma` , which will replace the reference with the lemma number like so: prf:refmy-lemma. When an explicit text is provided, this caption will serve as the title of the reference.
A definition directive can be included using the prf:definition pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your definition that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the definition’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off definition auto numbering.
Example
MyST Syntax
````{prf:definition}
:label: my-definition
The *economical expansion problem* (EEP) for
$(A,B)$ is to find a semi-positive $n$-vector $p>0$
and a number $\beta\in\mathbb{R}$, such that
$$
&\min_{\beta} \hspace{2mm} \beta \\
&\text{s.t. }\hspace{2mm}Bp \leq \beta Ap
$$
````
Source: QuantEcon
You can refer to a definition using the {prf:ref} role like: {prf:ref}`my-definition` , which will replace the reference with the definition number like so: prf:refmy-definition. When an explicit text is provided, this caption will serve as the title of the reference.
A criterion directive can be included using the prf:criterion pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your criterion that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the criterion’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off criterion auto numbering.
Example
MyST Syntax
````{prf:criterion} Weyl's criterion
:label: weyls-criterion
Weyl's criterion states that the sequence $a_n$ is equidistributed modulo $1$ if
and only if for all non-zero integers $m$,
```{math}
\lim_{n \rightarrow \infty} \frac{1}{n} \sum_{j=1}^{n} \exp^{2 \pi i m a_j} = 0
```
````
Source: Wikipedia
You can refer to a criterion using the {prf:ref} role like: {prf:ref}`weyls-criterion` , which will replace the reference with the criterion number like so: prf:refweyls-criterion. When an explicit text is provided, this caption will serve as the title of the reference.
A remark directive can be included using the prf:remark pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your remark that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the remark’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off remark auto numbering.
Example
MyST Syntax
```{prf:remark}
:label: my-remark
More generally there is a class of density functions
that possesses this feature, i.e.
$$
\exists g: \mathbb{R}_+ \mapsto \mathbb{R}_+ \ \ \text{ and } \ \ c \geq 0,
\ \ \text{s.t. the density } \ \ f \ \ \text{of} \ \ Z \ \
\text{ has the form } \quad f(z) = c g(z\cdot z)
$$
This property is called **spherical symmetry** (see p 81. in Leamer
(1978))
```
Source: QuantEcon
You can refer to a remark using the {prf:ref} role like: {prf:ref}`my-remark` , which will replace the reference with the remark number like so: prf:refmy-remark. When an explicit text is provided, this caption will serve as the title of the reference.
Example
MyST Syntax
```{prf:conjecture} Fake $\gamma$ conjecture
:label: my-conjecture
This is a dummy conjecture to illustrate that one can use math in titles.
```
You can refer to a conjecture using the {prf:ref} role like: {prf:ref}`my-conjecture` , which will replace the reference with the conjecture number like so: prf:refmy-conjecture. When an explicit text is provided, this caption will serve as the title of the reference.
A corollary directive can be included using the prf:corollary pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your corollary that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the corollary’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off corollary auto numbering.
Example
MyST Syntax
```{prf:corollary}
:label: my-corollary
If $A$ is a convergent matrix, then there exists a matrix norm such
that $\vert \vert A \vert \vert < 1$.
```
Source: QuantEcon
You can refer to a corollary using the {prf:ref} role like: {prf:ref}`my-corollary` , which will replace the reference with the corollary number like so: prf:refmy-corollary. When an explicit text is provided, this caption will serve as the title of the reference.
An algorithm directive can be included using the prf:algorithm pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your algorithm that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the algorithm’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off algorithm auto numbering.
Example
MyST Syntax
```{prf:algorithm} Ford–Fulkerson
:label: my-algorithm
**Inputs** Given a Network $G=(V,E)$ with flow capacity $c$, a source node $s$, and a sink node $t$
**Output** Compute a flow $f$ from $s$ to $t$ of maximum value
1. $f(u, v) \leftarrow 0$ for all edges $(u,v)$
2. While there is a path $p$ from $s$ to $t$ in $G_{f}$ such that $c_{f}(u,v)>0$
for all edges $(u,v) \in p$:
1. Find $c_{f}(p)= \min \{c_{f}(u,v):(u,v)\in p\}$
2. For each edge $(u,v) \in p$
1. $f(u,v) \leftarrow f(u,v) + c_{f}(p)$ *(Send flow along the path)*
2. $f(u,v) \leftarrow f(u,v) - c_{f}(p)$ *(The flow might be "returned" later)*
```
Source: Wikipedia
You can refer to a algorithms using the {prf:ref} role like: {prf:ref}`my-algorithm` , which will replace the reference with the algorithm number like so: prf:refmy-algorithm. When an explicit text is provided, this caption will serve as the title of the reference.
An example directive can be included using the prf:example pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your example that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the example’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off example auto numbering.
Example
MyST Syntax
````{prf:example}
:label: my-example
Next, we shut down randomness in demand and assume that the demand shock
$\nu_t$ follows a deterministic path:
```{math}
\nu_t = \alpha + \rho \nu_{t-1}
```
Again, we’ll compute and display outcomes in some figures
```python
ex2 = SmoothingExample(C2=[[0], [0]])
x0 = [0, 1, 0]
ex2.simulate(x0)
```
````
Source: QuantEcon
You can refer to an example using the {prf:ref} role like: {prf:ref}`my-example` , which will replace the reference with the example number like so: prf:refmy-example. When an explicit text is provided, this caption will serve as the title of the reference.
A property directive can be included using the prf:property pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your property that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the property’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off property auto numbering.
Example
MyST Syntax
```{prf:property}
:label: my-property
This is a dummy property to illustrate the directive.
```
You can refer to a property using the {prf:ref} role like: {prf:ref}`my-property` , which will replace the reference with the property number like so: prf:refmy-property. When an explicit text is provided, this caption will serve as the title of the reference.
An observation directive can be included using the prf:observation pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your observation that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the observation’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off observation auto numbering.
Example
MyST Syntax
```{prf:observation}
:label: my-observation
This is a dummy observation directive.
```
You can refer to an observation using the {prf:ref} role like: {prf:ref}`my-observation` , which will replace the reference with the observation number like so: prf:refmy-observation. When an explicit text is provided, this caption will serve as the title of the reference.
A proposition directive can be included using the prf:proposition pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your proposition that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the proposition’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off proposition auto numbering.
Example
MyST Syntax
```{prf:proposition}
:label: my-proposition
This is a dummy proposition directive.
```
You can refer to a proposition using the {prf:ref} role like: {prf:ref}`my-proposition` , which will replace the reference with the proposition number like so: prf:refmy-proposition. When an explicit text is provided, this caption will serve as the title of the reference.
An assumption directive can be included using the prf:assumption pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
label : text
A unique identifier for your assumption that you can use to reference it with {prf:ref}. Cannot contain spaces or special characters.
class : text
Value of the assumption’s class attribute which can be used to add custom CSS or JavaScript.
nonumber : flag (empty)
Turns off assumption auto numbering.
Example
MyST Syntax
```{prf:assumption}
:label: my-assumption
This is a dummy assumption directive.
```
You can refer to an assumption using the {prf:ref} role like: {prf:ref}`my-assumption` , which will replace the reference with the assumption number like so: prf:refmy-assumption. When an explicit text is provided, this caption will serve as the title of the reference.
Directive content can be hidden using the dropdown class which is available through sphinx-togglebutton. If your project utilizes the MyST-NB extension, there is no need to activate sphinx-togglebutton since it is already bundled with MyST-NB.
For Sphinx projects, add "sphinx_togglebutton" to your extensions list in conf.py to activate the extension
extensions = [
...
"sphinx_togglebutton"
...
]
For Jupyter Book projects, add sphinx_togglebutton under extra_extensions
sphinx:
extra_extensions:
- sphinx_togglebutton
To hide the directive, simply add :class: dropdown as a directive option.
Example
MyST Syntax:
```{prf:theorem}
:class: dropdown
This is an example of how to hide the content of a directive.
```